#include "main.h"
#include "setwindow.h"
#include "ui_setwindow.h"

//槽
    //接收来自mainwindow的数据
void setWindow::DataFromMainWindow(QString str)
{
    //更新显示
    ui->topedit->setText(str);
    ui->targetdate->setDate(T_DATE);
}
    //显示窗口
void setWindow::ShowWinodw()
{
    this->show();
}

setWindow::setWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::setWindow)
{
    ui->setupUi(this);
}

setWindow::~setWindow()
{
    delete ui;
}
//应用按钮被单击
void setWindow::on_pushButton_clicked()
{
    //更改目标日期
    T_DATE = ui->targetdate->date();
    //更改界面标题
    emit SendDataToMainWindow(ui->topedit->text());

}

void setWindow::on_pushButton_2_clicked()
{
    on_pushButton_clicked();
    this->hide();
}
